package com.lgl.scsheader.information.controller;

import com.lgl.scsapi.system.model.PageData;
import com.lgl.scsheader.base.controller.BaseController;
import com.lgl.scsheader.information.service.AddressService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 地址处理
 */
@Controller
@RequestMapping(value="/address")
public class AddressController extends BaseController{
	@Resource(name="addressService")
	private AddressService addressService;
	
	//通过条件获取城市集合
	@RequestMapping(value="queryCityList",produces="application/json;charset=UTF-8")
	@ResponseBody
	public Object queryCityList() throws Exception {
		Map<String, Object> cityMap = new HashMap<String, Object>(1);
		PageData pd = this.getPageData();
		List<PageData> cityList = addressService.listAllCities(pd);
		cityMap.put("cityList", cityList);
		return cityMap;
	}
	
}